home *** CD-ROM | disk | FTP | other *** search
- Path: news.MWCI.NET!usenet
- From: stuffle@pcii.net
- Newsgroups: comp.lang.c++
- Subject: Re: Overload >> vs. Write Met
- Date: 30 Jan 1996 19:40:45 GMT
- Organization: MidWest Communications, Inc.
- Message-ID: <4els7t$n54@hihat.mwci.net>
- References: <60125190005$71C7@lasernet.com>
- Reply-To: stuffle@pcii.net
- NNTP-Posting-Host: lan-pm1-30.pcii.net
- X-Newsreader: IBM NewsReader/2 v1.2.5
-
- In <60125190005$71C7@lasernet.com>, GEORGE BOUTWELL <george_boutwell@lasernet.com> writes:
- >Ok...
- >
- > Which is 'better' OOP 'Style', and/or 'Correctness' for
- >Writing/Reading an Object's Data to/from Disk/Screen/Etc:
- >
- >Overloading the << and >>
- >-or-
- >writing a read method and a write method?
- >
- >Regards,
- >
- >George
- >
- > * OLX 1.53 * >ov++h+n AC*hanks for hanging up, dear.
-
- I would say "make it streamable!!" If for any other reason, simply because
- it is a nice, object independent mechanism for writting to a stream. Plus, the
- syntax is much cleaner.
-
- ex:
- ostream os;
- int i;
- TObj1 to1; // TObj1 & TObj2 NOT related.
- TObj2 to2;
-